Skip to content

FEATURE: basic notation standard#2

Open
Segelzwerg wants to merge 72 commits into
mainfrom
feature/notation_definition
Open

FEATURE: basic notation standard#2
Segelzwerg wants to merge 72 commits into
mainfrom
feature/notation_definition

Conversation

@Segelzwerg

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
@Segelzwerg Segelzwerg self-assigned this Nov 15, 2022
@Segelzwerg Segelzwerg added the enhancement New feature or request label Nov 15, 2022
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
ADD: ref anchor

Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
READD: fail on warning

Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
READD: fail on warning

Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com>
@Segelzwerg Segelzwerg marked this pull request as ready for review October 29, 2024 20:54
@Segelzwerg Segelzwerg requested a review from iTitus October 29, 2024 20:54
Comment thread docs/source/standard.rst
Comment thread docs/source/standard.rst Outdated
Comment thread docs/source/standard.rst
Comment thread docs/source/standard.rst Outdated
Comment thread docs/source/standard.rst
@Segelzwerg Segelzwerg requested a review from iTitus November 2, 2024 10:55
Comment thread docs/source/standard.rst Outdated
Comment thread docs/source/standard.rst Outdated
Comment thread notation/header.py Outdated
Comment thread docs/source/standard.rst Outdated
Comment on lines +42 to +52
[[stack.card]]
suit="heart"
rank="A"
[[data.stack.card]]
suit="heart"
rank="K"

[[hands.player_1]]
[[hands.player_1.card]]
suit="heart"
rank="2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this toml is a little bit weird.
a table uses [...] while a table in an array uses [[...]].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check out this and the following paragraphs about tables and arrays of tables: https://toml.io/en/v1.0.0#array

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also thinking, that actually don't need the hands, right?

Comment thread notation/stack.py
Comment on lines +10 to +24
class Stack:
"""A list of cards."""

def __init__(self, cards: List[Card]):
"""
Construct a stack of cards.

:param cards: A list of cards.
"""
self._card_list: List[Card] = cards

def dumps(self) -> str:
"""Return the stack as TOML string."""
card_dump = {'cards': [card.dict() for card in self._card_list]}
return tomlkit.dumps({'stack': card_dump})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a stack class is not very pythonic, because this could just be a list.
the wrapping is nice for encapsulation though. so its fine i guess.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why is the representation {stack={cards=[<card-list>]}} ? why wrap it two times?
it could just be written as an array of cards

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think I had something else in mind originally where I needed an array. I try to change to an array.

Segelzwerg and others added 8 commits November 2, 2024 13:38
Co-authored-by: iTitus <iTitus@users.noreply.github.com>
Co-authored-by: iTitus <iTitus@users.noreply.github.com>
Co-authored-by: iTitus <iTitus@users.noreply.github.com>
@Segelzwerg Segelzwerg requested a review from iTitus November 2, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants